<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <script src="vue.js"></script>
</head>

<body>
    <div id="root">

        <h1>haha</h1>
        <template v-for="(item,index) in count2">

            <h1>{{y}}</h1>

        </template>

        <template v-for="(item,index) in count">

            <button>{{x}}</button>

        </template>



        <br />
        <hr />
        <button @click="addRow">点我增加一行</button>
        <button @click="addOne">点我增加一个按钮</button>

    </div>




    <script>
        Vue.config.productionTip = false;

        const vm = new Vue({
            el: '#root',
            data: {
                x: 'haha, 我是新增的按钮',
                count: 0,
                y: 'haha, 我是新增的一行',
                count2: '',
            },
            methods: {
                addRow() {
                    this.count2 = 1
                },
                addOne() {
                    this.count += 1
                },
            },
        })
    </script>
</body>

</html>